<?php


namespace App\Models\Garbage;
use Illuminate\Database\Eloquent\Model;

class GarbagePoint extends Model
{
    /**
     *
     */
    protected $table = 'garbage_points';
    protected $fillable = ['no','event_point','point','event','user_id','kind'];
    public function user(){
        return $this->belongsTo(WeichatUser::class,'user_id');
    }
    //通过积分表 反向查找通过购买商品所发生的积分变动 购买商品的行为kind为1
    public function goodPurchase()
    {
        return $this->hasOne(GarbageGoodPurchase::class,'change_id')->with('goods');
    }


}